package com.lagou.service.impl;

import com.lagou.common.Common;
import com.lagou.service.HiService;
import org.apache.dubbo.config.annotation.Service;
import org.apache.dubbo.rpc.RpcContext;

@Service
public class HiServiceImpl implements HiService {

    @Override
    public String sayHi(String name) {
        String ip = RpcContext.getContext().getAttachment(Common.REQUEST_IP);
        System.out.println("请求ip:" + ip);
        return "hi:"+name;
    }
}
